#include<iostream>
#include <string>
using namespace std;
int main(){
	int n,m,i;
	cin>>n>>m;
	string s1(m*2+1,'+');  
	string s2(m*2+1,'|');
	for(i=1;i<=m*2;i+=2){
		s1[i]='-';
		s2[i]='*';
	}
	for(i=0;i<=n;i++){
		cout<<s1<<endl;
	 if(i<n)
			cout<<s2<<endl;
	}
	return 0;
}